package com.fupan.Topic;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class JinghaoQueryConsumer {


    @RabbitListener(queues = "jingHaoQueue")
    public void onMsg(String msg , Channel channel, Message message) throws IOException {
        System.out.println("JingHaoQueueConsumer : "+msg);

        //手动ack
        channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
    }

}
